How to append to a file as sudo? [closed]
        Posted  
        
            by 
                obvio171
            
        on Super User
        
        See other posts from Super User
        
            or by obvio171
        
        
        
        Published on 2010-05-01T05:50:00Z
        Indexed on 
            2012/07/02
            15:18 UTC
        
        
        Read the original article
        Hit count: 205
        
Possible Duplicate:
sudo unable to write to /etc/profile
I want to do:
echo "something" >> /etc/config_file
But, since only the root user has write permission to this file, I can't do that. But this:
sudo echo "something" >> /etc/config_file
also doesn't work. Is there any way to append to a file in that situation without having to first open it with a sudo'd editor and then appending the new content by hand?
© Super User or respective owner